<!doctype html>
<html lang="zh-CN" th:replace="web-layout :: layout(~{::title}, ~{::style}, ~{}, ~{::script}, ~{::body}, 'userExam')"
      xmlns:th="http://www.thymeleaf.org">
<head>
    <title>试卷列表</title>
    <style>

    </style>
    <script>
        $("#loadMore").click(function () {
            dataList()
        })

        var main = $("#dataList");                     //主体元素
        function dataList() {
            $.post("/exam/child/list", {name: $("#name").val()}, function (result) {
                main.append(result);
            });
        }
    </script>
</head>
<body>
<!--<h2 th:text="${exam.name}"></h2>
<hr>-->
<ol class="breadcrumb">
    <li><a href="/user/exam/list">考试列表</a></li>
    <li class="active" th:text="${exam.name}"></li>
</ol>
<div th:if="${#lists.isEmpty(list)}">
    <p class="text-center">暂无数据！</p>
</div>
<div class="fyl-mb20">考试介绍：[[${exam.description}]]</div>
<div class="panel panel-default" th:if="${!#lists.isEmpty(list)}">
    <table class="table">
        <thead>
        <tr>
            <th>试卷名称</th>
            <th>答卷时间</th>
            <th>试卷状态</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <tr th:each="item:${list}" th:object="${item}">
            <td th:text="*{name}"></td>
            <td th:text="*{time}+'分钟'"></td>
            <td th:switch="*{uepStatus}">
                <span th:case="null">未完成</span>
                <span th:case="0">未完成</span>
                <span th:case="1">已完成</span>
                <span th:case="2">待阅卷</span>
            </td>
            <td>
                <a th:href="@{/user/paper/info/{examId}/{paperId}/{userExamId}(examId=${exam.id},paperId=*{id},userExamId=${userExamId})}" th:if="*{uepStatus}==null">开始答题</a>
                <a th:href="@{/user/paper/info/{examId}/{paperId}/{userExamId}(examId=${exam.id},paperId=*{id},userExamId=${userExamId})}" th:if="*{uepStatus}==0">继续答题</a>
                <a th:href="@{/user/paper/parse/{examId}/{paperId}/{userExamId}/{userPaperId}(examId=${exam.id},paperId=*{id},userExamId=${userExamId},userPaperId=*{userPaperId})}" th:if="*{uepStatus}==1 or *{uepStatus}==2">查看解析</a>
            </td>
        </tr>
        </tbody>
    </table>
</div>
</body>
</html>